package mvp.levelup.springmvc.demo.init;

import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.servlet.DispatcherServlet;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;

/**
 * Created by Valera on 14.09.2014.
 */
public class MyWebAppInitializer implements WebApplicationInitializer {
    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        ServletRegistration.Dynamic reg = servletContext.addServlet("dispatcher", DispatcherServlet.class);
        reg.setLoadOnStartup(1);
        reg.addMapping("/demo/*");
    }
}
